home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / util / autoidle.sit / AutoIdle doc next >
Text File  |  1987-12-21  |  5KB  |  102 lines

  1. AutoIdle Documentation 12/21/87
  2. Larry Rosenstein
  3.  
  4. This is yet another of those automatic screen blanking utilities, called
  5. AutoIdle.  It should be compatible with all versions of the Macintosh,
  6. including a Mac II with multiple screens.  It is also compatible with Multifinder.
  7.  
  8. To use it, you place the AutoIdle file in your System Folder and reboot the
  9. machine.  After 5 minutes of inactivity, the screen will be blanked and an
  10. icon will appear at random places of the screen.  In general, AutoIdle tries
  11. to display the icon of the application that  is running.  You can modify this
  12. as described below.  The name of the application will appear under the
  13. icon.  
  14.  
  15. To restore the screen, move the mouse, click the mouse, hit a key, or 
  16. insert a diskette.  The screen will also be restored if a window is created
  17. or removed from the screen.  (This is useful when downloading a file, for
  18. example, since you will notice when the download finished.)  Any of these actions
  19. also resets the 5 minute delay.
  20.  
  21. If you move the mouse in a special rectangle of the screen, it will be
  22. blanked immediately.  Initially this is defined by the coordinates (0, 0) and
  23. (2, 2), but can be changed.  You must leave the mouse in that position for
  24. about 1/2 second before the screen will be blanked.
  25.  
  26. The advantage of AutoIdle is that it doesn't take over the machine when it
  27. blanks the screen.  In fact you can be downloading a file from a BBS and the
  28. screen can be blanked, yet the download will continue.  The same is true of
  29. printing.
  30.  
  31. The downside of this is that AutoIdle does not save the original screen
  32. display and relies on the application to regenerate it.  Also, it doesn't try
  33. to prevent the application from changing the display.  If the application
  34. does change the display the utility will just  blank the screen again.  (You
  35. can see why it doesn't make sense for the utility to save the screen
  36. display, since the application might be changing it.)
  37.  
  38. AutoIdle works by intercepting the GetNextEvent and TickCount traps in the 
  39. Macintosh, and blanking/restoring the screen when the application calls those
  40. traps.  This design makes it very unobtrusive, but it also means that AutoIdle
  41. won't get control unless the application calls one of these traps.  So if you are 
  42. doing a long computation, the screen might never be blanked.
  43.  
  44. You can customize AutoIdle using ResEdit.  Inside the file is a resource of
  45. type 'idle'.  The first 4 bytes of the resource is the delay (in 1/60 seconds)
  46. until blanking the screen; the next 4 bytes the delay between moving the
  47. icon; the next 8 bytes is the magic rectangle (in screen coordinates).  The
  48. rest of the resource is a list of possible icons to use.
  49.  
  50. The icon list starts with 2 bytes which is the number of icons.  Then comes
  51. a series of pairs (resource type, resource ID).  To choose the icon, AutoIdle
  52. just runs down the list until it finds one of those resources.  The default
  53. list consists of:
  54.  
  55.     ICN# 128    usually the application's icon
  56.     ICN# 131    folder icon in Finder
  57.     ICN# 3        Mac icon in System file
  58.  
  59. If AutoIdle doesn't find an icon, it uses a gray rectangle.  This will never
  60. happen in the default case because ICN# 3 will always be found.
  61.  
  62. Accompanying AutoIdle should be a file called AutoIdle TMPL.  If you open
  63. this file in ResEdit you will find a resource of type TMPL.  If you paste this
  64. resource into ResEdit itself, then you will be able to edit the 'idle'
  65. resource in a convenient way (rather than as hex).  If you do this, make
  66. sure that the ID of the AutoIdle TMPL resource doesn't conflict with
  67. another TMPL in your version of ResEdit.
  68.  
  69. Please send all your comments & suggestions to me.  One things I would
  70. like to do is write an application that allows you to customize  the 'idle'
  71. resource without using ResEdit, but I haven't done it yet.
  72.  
  73. Send those cards & letters to:
  74.  
  75.     Larry Rosenstein
  76.     Apple Computer, Inc.
  77.     20525 Mariani M/S 32-E
  78.     Cupertino, CA 95014
  79.  
  80. Usenet:    {sun, nsc}!apple!lsr
  81. CSNet:    lsr@Apple.com
  82. AppleLink:    Rosenstein1
  83.  
  84.  
  85. Change History:
  86.  
  87. 1.0a7   11/6/87:    First version posted to Usenet & beyond.
  88. 1.0a10  12/21/87:    Second version posted to Usenet.
  89.                     Fixed bug with not preserving the current port
  90.                         (some applications would get a funny font in its
  91.                         menus, or start using the wrong port).
  92.                     Made mouse move restore the screen.
  93.                     Clicking is not required to blank the screen immediately.
  94.                     Use a patch to PostEvent to tell when an event comes in.
  95.                     Calls to TickCount can cause screen blanking.
  96.                     Preserve most of the registers.
  97.                     Fixed problem with color support; needed to set the
  98.                         current GDevice before calling Index2Color.
  99.                     Shrink the GrayRgn to nothing when blanking to prevent
  100.                         "behaved" applications from drawing on the screen.
  101.                         
  102.